package com.example.demo.Timmer;

import com.example.demo.Service.ExecRegistService;
import com.example.demo.Service.ZDghService;
import com.example.demo.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2018-06-03.
 */
@Component
public class DemoTimer {
    private Logger logger = LoggerFactory.getLogger(DemoTimer.class);
    @Autowired
    @Qualifier("ZDghService")
    private ZDghService service;

    @Scheduled(cron = "0 0 2 * * ?")
    public void onTimeSchedule() {
        service.zdgh();
        logger.error("预约挂号定时器运行:运行时间是："+ DateUtils.Getdnowdatexx());
        System.out.print("run task + 定时器运行"+"运行时间是" +"\n");
    }
}
